package exam.test15;

/**
 * Book: keep information about books in library
 * User:
 * Date: 2020-12-12
 * Time: 10:23
 */
public class Book {
    private static int BOOK_ID = 1;

    private String title;
    private int id;
    private double rental_day_price;
    private int number_copies;

    public Book(String title) {
        this.id = BOOK_ID++;
        this.title = title;
    }

    public Book(String title, double rental_day_price, int number_copies) {
        this.id = BOOK_ID++;
        this.title = title;
        this.rental_day_price = rental_day_price;
        this.number_copies = number_copies;
    }

    public double rentBook(int numberOfDay) {
        if (numberOfDay <= 0) {
            return 0;
        }
        return rental_day_price * numberOfDay;
    }

}
